# $< stand for the first file of prerequirefiles
# $@ stand for the target files
# $^ stand for all of the prerequirefiles
# %.o:%.cpp stand for the files which replace the %.o's suffix with .cpp
# use -gstabs+ or -gdwarf-2 to get more debug info ??
export MAKEROOT := ../..

PROTOCOL_TARGET := libprotocol.so.3
export SRCFILES := casc_pack.cpp des.cpp imsc_pack.cpp ipcsc_pack.cpp mpcsc_pack.cpp sc_head.cpp ./system_message/sl_pack.cpp \
	smsc_pack.cpp smsstrc_pack.cpp ss_head.cpp tbsc_pack.cpp tbsstrc_pack.cpp ./system_message/sl_head.cpp

include $(MAKEROOT)/template.mk

PROTOCOL_OBJS := $(SRCFILES:%.cpp=$(OBJDIR)/%.o)
LDFLAGS := -lz $(LDFLAGS)
PROTOCOL_TARGET_PATH := $(BINDIR)/$(PROTOCOL_TARGET)

all: $(PROTOCOL_TARGET_PATH) 

$(PROTOCOL_TARGET_PATH):$(PROTOCOL_OBJS)
	$(CC) $(SHARED) -o $@ $^ $(LDFLAGS)

clean:
	-rm -f *.d $(PROTOCOL_TARGET_PATH) $(PROTOCOL_OBJS)


